package com.playball.lottery.customview;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Color;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.playball.lottery.R;
//import com.playball.lottery.frm.buyhall.JddJCZQActivity;
import com.playball.lottery.frm.buyhall.BDActivity;
import com.playball.lottery.util.DateUtil;

/**
 * 北单购彩选号操作界面数据适配器
 * 
 * @author zhoujun
 * 
 */
public class BaseGroupAdapter2 extends BaseAdapter {

	/** 定义一个内部类，用于保存父View */
	class GroupExpandableListHolder {
		TextView title;
		ImageView indicator;
	}

	/** 定义一个内部类，用于保存子View,让球胜平负和胜平负使用 */
	class ChildExpandableListHolderRQSPF {
		TextView tv_item_no, tv_item_no_endtime, tv_matchname;
		TextView tv_hteam, tv_vteam, tv_item_vs_or_rq;
		Button btn_s;
		Button btn_p;
		Button btn_f;
	}

	/** 定义一个内部类，用于保存子View,半全场使用 */
	class ChildExpandableListHolderBQC {
		TextView tv_item_num, tv_item_no_endtime, tv_matchname, tv_hteam, tv_vteam;
		Button button01;
		LinearLayout llBQCGridview;
		JczqGridview bqcGridview;
		BDBqcgridviewAdapter myBQCGridAdapter;
	}

	/** 定义一个内部类，用于保存子View,总进球使用 */
	class ChildExpandableListHolderZJQ {
		TextView tv_item_no, tv_matchname, tv_hteam, tv_vteam, tv_item_endtime;
		JczqGridview zjqGridView;
		BDZJQGridviewAdapter myZJQGridAdapter;
	}

	/** 定义一个内部类，用于保存子View,上下单双使用 */
	class ChildExpandableListHolderSXDS {
		TextView tv_item_num, tv_item_no_endtime, tv_matchname;
		TextView tv_hteam, tv_vteam;
		Button btn_sd;
		Button btn_ss;
		Button btn_xd;
		Button btn_xs;

	}

	/** 定义一个内部类，用于保存子View,比分使用 */
	class ChildExpandableListHolderBF {
		TextView tv_item_num, tv_item_no_endtime, tv_matchname, tv_hteam, tv_vteam;
		Button button01;
		Button button02;
		Button button03;

		LinearLayout llBFSGridview;
		JczqGridview bFSGridview;
		BDBfgridviewAdapter bFSGridAdapter;

		LinearLayout llBFPGridview;
		JczqGridview bFPGridview;
		BDBfgridviewAdapter bFPGridAdapter;

		LinearLayout llBFFGridview;
		JczqGridview bFFGridview;
		BDBfgridviewAdapter bFFGridAdapter;
	}

	private String BDWF;
	private Context context; // 父activity
	private LayoutInflater mChildInflater; // 用于加载listitem的布局xml
	private List<ChildDTO> groups; // 所有group
	private ArrayList<ChildDTO> list_children = new ArrayList<ChildDTO>();// 零时存储选择的赛事，由BDActivity来回调

	/**
	 * 构造方法
	 * 
	 * @param c
	 *            － activity
	 * @param
	 *            － 所有group
	 */

	public BaseGroupAdapter2(Context c, List<ChildDTO> childs) {
		context = c;
		mChildInflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.groups = childs;
	}

	public BaseGroupAdapter2(Context c, List<ChildDTO> childs, String strBDWF) {
		context = c;
		mChildInflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.groups = childs;
		BDWF = strBDWF;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return groups.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return groups.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// Log.v("basegroupadapter", "getChildView 开始执行");
		if (BDWF.equals("RQSPF")) {
			ChildExpandableListHolderRQSPF holderRqspf = null; // 清空临时变量
			if (convertView == null) { // 若行未初始化
				// 通过flater初始化行视图
				convertView = mChildInflater.inflate(R.layout.ui_new_bd_rqspf_item,
						null);
				// Log.d("basegroupadapter", "getChildView RQSPF开始执行");
				// 并将行视图的5个子视图引用放到tag中
				holderRqspf = new ChildExpandableListHolderRQSPF();
				holderRqspf.tv_item_no = (TextView) convertView
						.findViewById(R.id.tv_item_num);
				holderRqspf.tv_item_no_endtime = (TextView) convertView
						.findViewById(R.id.tv_item_no_endtime);
				holderRqspf.tv_matchname = (TextView) convertView
						.findViewById(R.id.tv_item_match_name);
				holderRqspf.tv_hteam = (TextView) convertView
						.findViewById(R.id.tv_item_hteam);
				holderRqspf.tv_vteam = (TextView) convertView
						.findViewById(R.id.tv_item_vteam);
				holderRqspf.tv_item_vs_or_rq = (TextView) convertView
						.findViewById(R.id.tv_item_vs_or_rq);
				holderRqspf.btn_s = (Button) convertView
						.findViewById(R.id.btn_item_s);
				holderRqspf.btn_p = (Button) convertView
						.findViewById(R.id.btn_item_p);
				holderRqspf.btn_f = (Button) convertView
						.findViewById(R.id.btn_item_f);
				convertView.setTag(holderRqspf);
			} else { // 若行已初始化，直接从tag属性获得子视图的引用
				holderRqspf = (ChildExpandableListHolderRQSPF) convertView
						.getTag();
			}
			// 获得行数据（模型）
			final ChildDTO info = this.groups.get(position);
			if (info != null) {
				String str_eq = "VS";
				String str_nmu = "";
				// 根据模型数据，设置行视图的控件值
				if (!info.eQ.equals("0")) {
					if (info.eQ.startsWith("-")) {
//						str_eq = "(" + info.eQ + ")" + str_eq;
						str_eq = "(" + info.eQ + ")" ;
					} else {
//						str_eq = "(+" + info.eQ + ")" + str_eq;
						str_eq = "(+" + info.eQ + ")" ;
					}
				}
				if (info.nMm.length() < 4) {
					str_nmu = info.nMm;
				} else {
					str_nmu = info.nMm.substring(0, 4);
				}
				// holder.textView01.setText(DateUtil.getGameNo(info.mId) + "\n"
				// + str_nmu + "\n"
				// + DateUtil.getDateTime1(info.eTime) + "截止");
				holderRqspf.tv_item_no.setText(info.mId);
				holderRqspf.tv_item_no_endtime.setText(DateUtil.getDateTime1(info.eTime) + "截止");
				holderRqspf.tv_matchname.setText(str_nmu);
				if (info.BgColor==null||"".equals(info.BgColor)){
					holderRqspf.tv_matchname.setBackgroundColor(0xff000000);
				}else {
					holderRqspf.tv_matchname.setBackgroundColor(Color.parseColor(info.BgColor));
				}
				holderRqspf.tv_hteam.setText(info.hTeam);
				holderRqspf.tv_vteam.setText(info.vTeam);
				//holderRqspf.tv_item_vs_or_rq.setTextColor(0xfff54551);
				holderRqspf.tv_item_vs_or_rq.setText(str_eq);

				if (!"".equals(info.sPRqspf)) {
					if (info.str_sbtn) {
						//Log.d("van", info.str_sbtn +"--- 北单");
						holderRqspf.btn_s.setText(Html.fromHtml("<font size='18dip' color='#ffffff'>"+ info.hTeam + "</font><br>"  + "胜" +info.sPRqspf.split("-")[2] ) );
					}else {
						holderRqspf.btn_s.setText(Html.fromHtml("<font size='18dip' color='#000000'>"+ info.hTeam + "</font><br>"  + "胜"  +info.sPRqspf.split("-")[2] ) );
					}
					holderRqspf.tv_hteam.setText(info.sPRqspf.split("-")[2]);
					
					if (info.str_pbtn) {
						holderRqspf.btn_p.setText(Html.fromHtml("<font size='18dip' color='#ffffff'>"+info.eQ+"</font><br>"  + "平"  +info.sPRqspf.split("-")[1] ) );
					}else {
						holderRqspf.btn_p.setText(Html.fromHtml("<font size='18dip' color='#000000'>"+info.eQ+"</font><br>"  + "平"  +info.sPRqspf.split("-")[1]) );
					}
					holderRqspf.tv_item_vs_or_rq.setText(info.sPRqspf.split("-")[1]);
					
					if (info.str_fbtn) {
						holderRqspf.btn_f.setText(Html.fromHtml("<font size='18dip' color='#ffffff'>"+ info.vTeam + "</font><br>"  + "胜"  +info.sPRqspf.split("-")[0]) );
					}else {
						holderRqspf.btn_f.setText(Html.fromHtml("<font size='18dip' color='#000000'>"+ info.vTeam + "</font><br>"  + "胜"  +info.sPRqspf.split("-")[0]) );
					}
					holderRqspf.tv_vteam.setText( info.sPRqspf.split("-")[0] );
//					holderRqspf.btn_s.setText("胜" + info.sPRqspf.split("-")[0]);
//					holderRqspf.btn_p.setText("平" + info.sPRqspf.split("-")[1]);
//					holderRqspf.btn_f.setText("负" + info.sPRqspf.split("-")[2]);
				}

				holderRqspf.btn_s.setSelected(info.str_sbtn);
				holderRqspf.btn_s.setTag(info);

				holderRqspf.btn_p.setSelected(info.str_pbtn);
				holderRqspf.btn_p.setTag(info);

				holderRqspf.btn_f.setSelected(info.str_fbtn);
				holderRqspf.btn_f.setTag(info);
				// holder.button01.setOnClickListener(new Button01Listener());
				// holder.button02.setOnClickListener(new Button02Listener());
				// holder.button03.setOnClickListener(new Button03Listener());

				holderRqspf.btn_s
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button01 = (Button) v;
								ChildDTO child_info1 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info1.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新选中的值
								if (child_info1.str_sbtn) {
									if (!"".equals(info.sPRqspf)) {
										child_info1.setStr_sp(child_info1.str_sp.replace(
												"3,"
														+ info.sPRqspf
																.split("-")[0]
														+ "/", ""));
										child_info1.str_sbtn = false;
										button01.setSelected(child_info1.str_sbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info1.str_sp == null) {
										child_info1.str_sp = "";
									}
									if (!"".equals(info.sPRqspf)) {
										child_info1
												.setStr_sp(child_info1.str_sp
														+ "3,"
														+ info.sPRqspf
																.split("-")[0]
														+ "/");
										child_info1.str_sbtn = true;
										button01.setSelected(child_info1.str_sbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 判断str_sp是否为空，空的话就不回传赋值
								// 再存入List
								list_children.add(child_info1);

								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "RQSPF");

							}
						});

				holderRqspf.btn_p
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button02 = (Button) v;
								ChildDTO child_info2 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info2.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info2.str_pbtn) {
									if (!"".equals(info.sPRqspf)) {
										child_info2.setStr_sp(child_info2.str_sp.replace(
												"1,"
														+ info.sPRqspf
																.split("-")[1]
														+ "/", ""));
										child_info2.str_pbtn = false;
										button02.setSelected(child_info2.str_pbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info2.str_sp == null) {
										child_info2.str_sp = "";
									}
									if (!"".equals(info.sPRqspf)) {
										child_info2
												.setStr_sp(child_info2.str_sp
														+ "1,"
														+ info.sPRqspf
																.split("-")[1]
														+ "/");
										child_info2.str_pbtn = true;
										button02.setSelected(child_info2.str_pbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 再存入List
								list_children.add(child_info2);
								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "RQSPF");
							}
						});

				holderRqspf.btn_f
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button03 = (Button) v;
								ChildDTO child_info3 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info3.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info3.str_fbtn) {
									if (!"".equals(info.sPRqspf)) {
										child_info3.setStr_sp(child_info3.str_sp.replace(
												"0,"
														+ info.sPRqspf
																.split("-")[2]
														+ "/", ""));
										child_info3.str_fbtn = false;
										button03.setSelected(child_info3.str_fbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info3.str_sp == null) {
										child_info3.str_sp = "";
									}
									if (!"".equals(info.sPRqspf)) {
										child_info3
												.setStr_sp(child_info3.str_sp
														+ "0,"
														+ info.sPRqspf
																.split("-")[2]
														+ "/");
										child_info3.str_fbtn = true;
										button03.setSelected(child_info3.str_fbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 再存入List
								list_children.add(child_info3);
								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "RQSPF");

							}
						});
			}
		} else if (BDWF.equals("ZJQ")) {
			ChildExpandableListHolderZJQ holderZJQ = null; // 总进球清空临时变量
			if (convertView == null) { // 若行未初始化
				// 通过flater初始化行视图
				convertView = mChildInflater
						.inflate(R.layout.ui_new_bd_zjq_item, null);
				// 并将行视图的5个子视图引用放到tag中
				holderZJQ = new ChildExpandableListHolderZJQ();
				holderZJQ.tv_item_no = (TextView) convertView
						.findViewById(R.id.tv_item_no);
				holderZJQ.tv_item_endtime = (TextView) convertView
						.findViewById(R.id.tv_item_endtime);
				holderZJQ.tv_matchname = (TextView) convertView
						.findViewById(R.id.tv_item_match_name);
				holderZJQ.tv_hteam = (TextView) convertView
						.findViewById(R.id.tv_item_hteam);
				holderZJQ.tv_vteam = (TextView) convertView
						.findViewById(R.id.tv_item_vteam);
				holderZJQ.zjqGridView = (JczqGridview) convertView
						.findViewById(R.id.jczq_zjq_gridview);
				// holder.myGridView.setTag(childPosition);
				convertView.setTag(holderZJQ);
			} else { // 若行已初始化，直接从tag属性获得子视图的引用
				holderZJQ = (ChildExpandableListHolderZJQ) convertView.getTag();
				// holder.myGridView.setTag(childPosition);
			}
			// 获得行数据（模型）
			final ChildDTO info = this.groups.get(position);
			if (info != null) {
				String str_nmu = "";
				// 根据模型数据，设置行视图的控件值
				if (info.nMm.length() < 4) {
					str_nmu = info.nMm;
				} else {
					str_nmu = info.nMm.substring(0, 4);
				}
				// 格式修改 130909001 截取后3位001
				holderZJQ.tv_item_no.setText(info.mId);// holderZJQ.textView_wk.setText(info.mId.substring(info.mId.length()-3,
														// info.mId.length()));
				holderZJQ.tv_item_endtime.setText(DateUtil.getDateTime1(info.eTime) + "截止");
				holderZJQ.tv_matchname.setText(str_nmu);
				if (info.BgColor==null||"".equals(info.BgColor)){
					holderZJQ.tv_matchname.setBackgroundColor(0xff000000);
				}else {
					holderZJQ.tv_matchname.setBackgroundColor(Color.parseColor(info.BgColor));
				}
				holderZJQ.tv_hteam.setText(info.hTeam);
				holderZJQ.tv_vteam.setText(info.vTeam);
				String[] nums;
				if (!"".equals(info.sPzjq)) {
					nums = info.sPzjq.split(",");
					// // 初始化数据,初始默认全部未选中
					// // 按钮的文字
					String[] titles = new String[] { "0", "1", "2", "3", "4",
							"5", "6", "7+" };
					// // 开始展现
					holderZJQ.myZJQGridAdapter = new BDZJQGridviewAdapter(
							titles, nums, context, groups, position);
					holderZJQ.zjqGridView
							.setAdapter(holderZJQ.myZJQGridAdapter);// 设置菜单Adapter
				} else {
					Toast.makeText(context, R.string.no_sp, Toast.LENGTH_SHORT)
							.show();
				}
			}
		} else if (BDWF.equals("SXDS")) {
			ChildExpandableListHolderSXDS holderSXDS = null; // 清空临时变量
			if (convertView == null) { // 若行未初始化
				// 通过flater初始化行视图
				convertView = mChildInflater.inflate(R.layout.ui_new_bd_sxds_item,
						null);
				// Log.d("basegroupadapter", "getChildView SXDS开始执行");
				// 并将行视图的5个子视图引用放到tag中
				holderSXDS = new ChildExpandableListHolderSXDS();
				holderSXDS.tv_item_num = (TextView) convertView
						.findViewById(R.id.tv_item_num);
				holderSXDS.tv_item_no_endtime = (TextView) convertView
						.findViewById(R.id.tv_item_no_endtime);
				holderSXDS.tv_matchname = (TextView) convertView
						.findViewById(R.id.tv_item_match_name);
				holderSXDS.tv_hteam = (TextView) convertView
						.findViewById(R.id.tv_item_hteam);
				holderSXDS.tv_vteam = (TextView) convertView
						.findViewById(R.id.tv_item_vteam);
				holderSXDS.btn_sd = (Button) convertView
						.findViewById(R.id.btn_item_sd);
				holderSXDS.btn_ss = (Button) convertView
						.findViewById(R.id.btn_item_ss);
				holderSXDS.btn_xd = (Button) convertView
						.findViewById(R.id.btn_item_xd);
				holderSXDS.btn_xs = (Button) convertView
						.findViewById(R.id.btn_item_xs);
				convertView.setTag(holderSXDS);
			} else { // 若行已初始化，直接从tag属性获得子视图的引用
				holderSXDS = (ChildExpandableListHolderSXDS) convertView
						.getTag();
			}
			// 获得行数据（模型）
			final ChildDTO info = this.groups.get(position);
			if (info != null) {
				String str_eq = "";
				String str_nmu = "";
				// 根据模型数据，设置行视图的控件值
				if (!info.eQ.equals("0")) {
					if (info.eQ.startsWith("-")) {
						str_eq = "(" + info.eQ + ")";
					} else {
						str_eq = "(+" + info.eQ + ")";
					}
				}
				if (info.nMm.length() < 4) {
					str_nmu = info.nMm;
				} else {
					str_nmu = info.nMm.substring(0, 4);
				}
				// holder.textView01.setText(DateUtil.getGameNo(info.mId) + "\n"
				// + str_nmu + "\n"
				// + DateUtil.getDateTime1(info.eTime) + "截止");
				holderSXDS.tv_item_num.setText(info.mId);
				holderSXDS.tv_item_no_endtime.setText(DateUtil.getDateTime1(info.eTime) + "截止");
				holderSXDS.tv_matchname.setText(str_nmu);
				if (info.BgColor==null||"".equals(info.BgColor)){
					holderSXDS.tv_matchname.setBackgroundColor(0xff000000);
				}else {
					holderSXDS.tv_matchname.setBackgroundColor(Color.parseColor(info.BgColor));
				}
				holderSXDS.tv_hteam.setText(info.hTeam);
				holderSXDS.tv_vteam.setText(info.vTeam);
				if (!"".equals(info.sPBDsxds)) {
					// Log.v("getchildview", "info.sPBDsxds= "+info.sPBDsxds);
					// holderSXDS.button01.setText("上单\n" +
					// info.sPBDsxds.split("-")[0]);
					// holderSXDS.button02.setText("上双\n" +
					// info.sPBDsxds.split("-")[1]);
					// holderSXDS.button03.setText("下单\n" +
					// info.sPBDsxds.split("-")[2]);
					// holderSXDS.button04.setText("下双\n" +
					// info.sPBDsxds.split("-")[3]);
					if (info.str_sbtn) {
						holderSXDS.btn_sd
						.setText(Html
								.fromHtml("<b>上单</b><br><font  color='#ffffff'>"
										+ info.sPBDsxds.split("-")[0]
										+ "</font>"));
					}else {
						holderSXDS.btn_sd
						.setText(Html
								.fromHtml("<b>上单</b><br><font  color='#e54042'>"
										+ info.sPBDsxds.split("-")[0]
										+ "</font>"));
					}
				
					if (info.str_pbtn) {
						holderSXDS.btn_ss
						.setText(Html
								.fromHtml("<b>上双</b><br><font  color='#ffffff'>"
										+ info.sPBDsxds.split("-")[1]
										+ "</font>"));
					}else {
						holderSXDS.btn_ss
						.setText(Html
								.fromHtml("<b>上双</b><br><font  color='#e54042'>"
										+ info.sPBDsxds.split("-")[1]
										+ "</font>"));
					}
					
					if (info.str_fbtn) {
						holderSXDS.btn_xd
						.setText(Html
								.fromHtml("<b>下单</b><br><font  color='#ffffff'>"
										+ info.sPBDsxds.split("-")[2]
										+ "</font>"));
					}else {
						holderSXDS.btn_xd
						.setText(Html
								.fromHtml("<b>下单</b><br><font  color='#e54042'>"
										+ info.sPBDsxds.split("-")[2]
										+ "</font>"));
					}
					
					if (info.str_xsbtn) {
						holderSXDS.btn_xs
						.setText(Html
								.fromHtml("<b>下双</b><br><font  color='#ffffff'>"
										+ info.sPBDsxds.split("-")[3]
										+ "</font>"));
					}else {
						holderSXDS.btn_xs
						.setText(Html
								.fromHtml("<b>下双</b><br><font  color='#e54042'>"
										+ info.sPBDsxds.split("-")[3]
										+ "</font>"));
					}
					
					
				}

				holderSXDS.btn_sd.setSelected(info.str_sbtn);
				holderSXDS.btn_sd.setTag(info);

				holderSXDS.btn_ss.setSelected(info.str_pbtn);
				holderSXDS.btn_ss.setTag(info);

				holderSXDS.btn_xd.setSelected(info.str_fbtn);
				holderSXDS.btn_xd.setTag(info);

				holderSXDS.btn_xs.setSelected(info.str_xsbtn);
				holderSXDS.btn_xs.setTag(info);

				holderSXDS.btn_sd
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button01 = (Button) v;
								ChildDTO child_info1 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info1.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新选中的值
								if (child_info1.str_sbtn) {
									if (!"".equals(info.sPBDsxds)) {
										child_info1.setStr_sp(child_info1.str_sp.replace(
												"3,"
														+ info.sPBDsxds
																.split("-")[0]
														+ "/", ""));
										child_info1.str_sbtn = false;
										button01.setSelected(child_info1.str_sbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info1.str_sp == null) {
										child_info1.str_sp = "";
									}
									if (!"".equals(info.sPBDsxds)) {
										child_info1
												.setStr_sp(child_info1.str_sp
														+ "3,"
														+ info.sPBDsxds
																.split("-")[0]
														+ "/");
										child_info1.str_sbtn = true;
										button01.setSelected(child_info1.str_sbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 判断str_sp是否为空，空的话就不回传赋值
								// 再存入List
								list_children.add(child_info1);
								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "SXDS");

							}
						});

				holderSXDS.btn_ss
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button02 = (Button) v;
								ChildDTO child_info2 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info2.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info2.str_pbtn) {
									if (!"".equals(info.sPBDsxds)) {
										child_info2.setStr_sp(child_info2.str_sp.replace(
												"1,"
														+ info.sPBDsxds
																.split("-")[1]
														+ "/", ""));
										child_info2.str_pbtn = false;
										button02.setSelected(child_info2.str_pbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info2.str_sp == null) {
										child_info2.str_sp = "";
									}
									if (!"".equals(info.sPBDsxds)) {
										child_info2
												.setStr_sp(child_info2.str_sp
														+ "1,"
														+ info.sPBDsxds
																.split("-")[1]
														+ "/");
										child_info2.str_pbtn = true;
										button02.setSelected(child_info2.str_pbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 再存入List
								list_children.add(child_info2);
								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "SXDS");

							}
						});

				holderSXDS.btn_xd
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button03 = (Button) v;
								ChildDTO child_info3 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info3.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info3.str_fbtn) {
									if (!"".equals(info.sPBDsxds)) {
										child_info3.setStr_sp(child_info3.str_sp.replace(
												"0,"
														+ info.sPBDsxds
																.split("-")[2]
														+ "/", ""));
										child_info3.str_fbtn = false;
										button03.setSelected(child_info3.str_fbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info3.str_sp == null) {
										child_info3.str_sp = "";
									}
									if (!"".equals(info.sPBDsxds)) {
										child_info3
												.setStr_sp(child_info3.str_sp
														+ "0,"
														+ info.sPBDsxds
																.split("-")[2]
														+ "/");
										child_info3.str_fbtn = true;
										button03.setSelected(child_info3.str_fbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 再存入List
								list_children.add(child_info3);
								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "SXDS");

							}
						});

				holderSXDS.btn_xs
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button04 = (Button) v;
								ChildDTO child_info4 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								List delList = new ArrayList();
								for (ChildDTO child : list_children) {
									String jc_mid = child.getmId();
									if (child_info4.getmId() == jc_mid) {
										delList.add(child);
									}
								}
								list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info4.str_xsbtn) {
									if (!"".equals(info.sPBDsxds)) {
										child_info4.setStr_sp(child_info4.str_sp.replace(
												"4,"
														+ info.sPBDsxds
																.split("-")[3]
														+ "/", ""));
										child_info4.str_xsbtn = false;
										button04.setSelected(child_info4.str_xsbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								} else {
									if (child_info4.str_sp == null) {
										child_info4.str_sp = "";
									}
									if (!"".equals(info.sPBDsxds)) {
										child_info4
												.setStr_sp(child_info4.str_sp
														+ "4,"
														+ info.sPBDsxds
																.split("-")[3]
														+ "/");
										child_info4.str_xsbtn = true;
										button04.setSelected(child_info4.str_xsbtn);
									} else {
										Toast.makeText(context, R.string.no_sp,
												Toast.LENGTH_SHORT).show();
									}

								}
								// 再存入List
								list_children.add(child_info4);
								// 回调initMapData这个方法，转存到全局变量里，选号结束
								((BDActivity) context).initMapData(
										list_children, "SXDS");

							}
						});
			}

		} else if (BDWF.equals("BF")) {

			ChildExpandableListHolderBF holderBF = null; // 比分清空临时变量
			if (convertView == null) { // 若行未初始化
				// 通过flater初始化行视图
				convertView = mChildInflater.inflate(R.layout.ui_new_bd_bf_item, null);
				holderBF = new ChildExpandableListHolderBF();
				holderBF.tv_item_num = (TextView) convertView
						.findViewById(R.id.tv_item_num);
				holderBF.tv_item_no_endtime = (TextView) convertView
						.findViewById(R.id.tv_item_no_endtime);
				holderBF.tv_matchname = (TextView) convertView
						.findViewById(R.id.tv_item_match_name);
				holderBF.tv_hteam = (TextView) convertView
						.findViewById(R.id.tv_item_hteam);
				holderBF.tv_vteam = (TextView) convertView
						.findViewById(R.id.tv_item_vteam);
				holderBF.button01 = (Button) convertView
						.findViewById(R.id.btn_item_s);
				holderBF.button02 = (Button) convertView
						.findViewById(R.id.btn_item_p);
				holderBF.button03 = (Button) convertView
						.findViewById(R.id.btn_item_f);
				// 设置比分主胜gridview显示与否
				holderBF.llBFSGridview = (LinearLayout) convertView
						.findViewById(R.id.ll_myGridView_bfs);
				holderBF.bFSGridview = (JczqGridview) convertView
						.findViewById(R.id.myGridView_bfs);
				// 比分平gridview
				holderBF.llBFPGridview = (LinearLayout) convertView
						.findViewById(R.id.ll_myGridView_bfp);
				holderBF.bFPGridview = (JczqGridview) convertView
						.findViewById(R.id.myGridView_bfp);
				// 比分主负gridview
				holderBF.llBFFGridview = (LinearLayout) convertView
						.findViewById(R.id.ll_myGridView_bff);
				holderBF.bFFGridview = (JczqGridview) convertView
						.findViewById(R.id.myGridView_bff);
				convertView.setTag(holderBF);
			} else { // 若行已初始化，直接从tag属性获得子视图的引用
				holderBF = (ChildExpandableListHolderBF) convertView.getTag();
			}
			// 获得行数据（模型）
			final ChildDTO info = this.groups.get(position);
			if (info != null) {
				String str_nmu = "";
				// 根据模型数据，设置行视图的控件值
				if (info.nMm.length() < 4) {
					str_nmu = info.nMm;
				} else {
					str_nmu = info.nMm.substring(0, 4);
				}
				// holderBF.textView_wk.setText(DateUtil.getGameNo(info.mId));
				// 格式修改 130909001 截取后3位001
				holderBF.tv_item_num.setText(info.mId);
				holderBF.tv_item_no_endtime.setText(DateUtil.getDateTime1(info.eTime) + "截止");
				holderBF.tv_matchname.setText(str_nmu);
				if (info.BgColor==null||"".equals(info.BgColor)){
					holderBF.tv_matchname.setBackgroundColor(0xff000000);
				}else {
					holderBF.tv_matchname.setBackgroundColor(Color.parseColor(info.BgColor));
				}
				holderBF.tv_hteam.setText(info.hTeam);
				holderBF.tv_vteam.setText(info.vTeam);

				// 设置按钮文字为选择的内容
				if (info.getList_bfsgridview_selectconcent().size() <= 1) {
					holderBF.button01.setText(Html.fromHtml("<font size='14dip' color='#000000'>"+ info.hTeam  + "</font><br>"+info.btnbfscontent));
				} else {
					holderBF.button01.setText("胜多个");
				}
				if (info.getList_bfpgridview_selectconcent().size() <= 1) {
					holderBF.button02.setText(Html.fromHtml("<font size='14dip' color='#000000'>"+ "VS" + "</font><br>"+info.btnbfpcontent));
				} else {
					holderBF.button02.setText("平多个");
				}
				if (info.getList_bffgridview_selectconcent().size() <= 1) {
					holderBF.button03.setText(Html.fromHtml("<font size='14dip' color='#000000'>"+ info.vTeam  + "</font><br>"+info.btnbffcontent));
				} else {
					holderBF.button03.setText("负多个");
				}
				// holder.button02.setText(info.btnbfpcontent);
				// holder.button03.setText(info.btnbffcontent);

				holderBF.button01.setSelected(info.str_sbtn);
				holderBF.button01.setTag(info);

				holderBF.button02.setSelected(info.str_pbtn);
				holderBF.button02.setTag(info);

				holderBF.button03.setSelected(info.str_fbtn);
				holderBF.button03.setTag(info);
				// holder.button01.setOnClickListener(new Button01Listener());
				// holder.button02.setOnClickListener(new Button02Listener());
				// holder.button03.setOnClickListener(new Button03Listener());

				holderBF.button01
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button01 = (Button) v;
								ChildDTO child_info1 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								// List delList = new ArrayList();
								// for (ChildDTO child : list_children) {
								// String jc_mid = child.getmId();
								// if (child_info1.getmId() == jc_mid) {
								// delList.add(child);
								// }
								// }
								// list_children.removeAll(delList);
								// 判断赋新选中的值
								if (child_info1.str_sbtn) {

									// child_info1.setStr_sp(child_info1.str_sp.replace("3,"+info.sPspf.split("-")[0]+"/",
									// ""));
									// gridview不显示
									child_info1.setShowBFS(false);
									child_info1.str_sbtn = false;
									button01.setSelected(child_info1.str_sbtn);

								} else {
									child_info1.setShowBFS(true);
									// 主胜，平，主负，只能同时显示一个gridview
									child_info1.setShowBFP(false);
									child_info1.setShowBFF(false);

									// child_info1.setStr_sp(child_info1.str_sp
									// +
									// "3,"+info.sPspf.split("-")[0]+"/");
									child_info1.str_sbtn = true;
									// 主胜，平，主负按钮，只能同时显示一个按钮高亮
									child_info1.str_pbtn = false;
									child_info1.str_fbtn = false;

									button01.setSelected(child_info1.str_sbtn);

								}
								// 判断str_sp是否为空，空的话就不回传赋值
								// 再存入List
								// list_children.add(child_info1);
								// // 回调initMapData这个方法，转存到全局变量里，选号结束
								// ((BFActivity)
								// context).initMapData(list_children);
								notifyDataSetChanged();
							}
						});

				holderBF.button02
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button02 = (Button) v;
								ChildDTO child_info2 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								// List delList = new ArrayList();
								// for (ChildDTO child : list_children) {
								// String jc_mid = child.getmId();
								// if (child_info2.getmId() == jc_mid) {
								// delList.add(child);
								// }
								// }
								// list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info2.str_pbtn) {
									// gridview不显示
									child_info2.setShowBFP(false);
									child_info2.str_pbtn = false;
									button02.setSelected(child_info2.str_pbtn);

								} else {
									// gridview显示
									child_info2.setShowBFP(true);

									// 主胜，平，主负，只能同时显示一个gridview
									child_info2.setShowBFS(false);
									child_info2.setShowBFF(false);

									child_info2.str_pbtn = true;
									// 主胜，平，主负按钮，只能同时显示一个按钮高亮
									child_info2.str_sbtn = false;
									child_info2.str_fbtn = false;

									button02.setSelected(child_info2.str_pbtn);

								}
								// 再存入List
								// list_children.add(child_info2);
								// // 回调initMapData这个方法，转存到全局变量里，选号结束
								// ((BFActivity)
								// context).initMapData(list_children);
								notifyDataSetChanged();
							}
						});

				holderBF.button03
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button03 = (Button) v;
								ChildDTO child_info3 = (ChildDTO) v.getTag();
								// 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// 用来装需要删除的元素
								// List delList = new ArrayList();
								// for (ChildDTO child : list_children) {
								// String jc_mid = child.getmId();
								// if (child_info3.getmId() == jc_mid) {
								// delList.add(child);
								// }
								// }
								// list_children.removeAll(delList);
								// 判断赋新的值
								if (child_info3.str_fbtn) {
									// gridview不显示
									child_info3.setShowBFF(false);
									// child_info3.setStr_sp(child_info3.str_sp.replace("0,"+info.sPspf.split("-")[2]+"/",
									// ""));
									child_info3.str_fbtn = false;
									button03.setSelected(child_info3.str_fbtn);

								} else {
									// gridview不显示
									child_info3.setShowBFF(true);

									// 主胜，平，主负gridview，只能同时显示一个gridview
									child_info3.setShowBFS(false);
									child_info3.setShowBFP(false);

									// child_info3.setStr_sp(child_info3.str_sp
									// +
									// "0,"+info.sPspf.split("-")[2]+"/");
									child_info3.str_fbtn = true;

									// 主胜，平，主负按钮，只能同时显示一个按钮高亮
									child_info3.str_sbtn = false;
									child_info3.str_pbtn = false;

									button03.setSelected(child_info3.str_fbtn);

								}
								// 再存入List
								// list_children.add(child_info3);
								// // 回调initMapData这个方法，转存到全局变量里，选号结束
								// ((BFActivity)
								// context).initMapData(list_children);
								notifyDataSetChanged();
							}
						});

				// 设置比分主胜gridview显示与否
				if (info.isShowBFS == false) {
					holderBF.llBFSGridview.setVisibility(View.GONE);
				} else {
					holderBF.llBFSGridview.setVisibility(View.VISIBLE);
				}
				// 按钮的文字
				String[] bfs_titles = new String[] { "1:0", "2:0", "2:1",
						"3:0", "3:1", "3:2", "4:0", "4:1", "4:2", "胜其他" };
				String[] bfs_nums;
				// Log.v("bd", "info.sPbfs= "+info.sPbfs);
				if (!"".equals(info.sPbfs)) {
					bfs_nums = info.sPbfs.split("\\|");
					holderBF.bFSGridAdapter = new BDBfgridviewAdapter(
							bfs_titles, bfs_nums, context, groups, position,
							"bfs");
					holderBF.bFSGridview.setAdapter(holderBF.bFSGridAdapter);// 设置菜单Adapter
				} else {
					Toast.makeText(context, R.string.no_sp, Toast.LENGTH_SHORT)
							.show();
				}

				// 设置比分平gridview显示与否
				if (info.isShowBFP == false) {
					holderBF.llBFPGridview.setVisibility(View.GONE);
				} else {
					holderBF.llBFPGridview.setVisibility(View.VISIBLE);
				}
				// 按钮的文字
				String[] bfp_titles = new String[] { "0:0", "1:1", "2:2",
						"3:3", "平其他" };
				String[] bfp_nums;
				if (!"".equals(info.sPbfp)) {
					bfp_nums = info.sPbfp.split("\\|");
					holderBF.bFPGridAdapter = new BDBfgridviewAdapter(
							bfp_titles, bfp_nums, context, groups, position,
							"bfp");
					holderBF.bFPGridview.setAdapter(holderBF.bFPGridAdapter);// 设置菜单Adapter
				} else {
					Toast.makeText(context, R.string.no_sp, Toast.LENGTH_SHORT)
							.show();
				}

				// 设置比分主负gridview显示与否
				if (info.isShowBFF == false) {
					holderBF.llBFFGridview.setVisibility(View.GONE);
				} else {
					holderBF.llBFFGridview.setVisibility(View.VISIBLE);
				}
				// 按钮的文字
				String[] bff_titles = new String[] { "0:1", "0:2", "1:2",
						"0:3", "1:3", "2:3", "0:4", "1:4", "2:4", "负其他" };
				String[] bff_nums;
				if (!"".equals(info.sPbff)) {
					bff_nums = info.sPbff.split("\\|");
					holderBF.bFFGridAdapter = new BDBfgridviewAdapter(
							bff_titles, bff_nums, context, groups, position,
							"bff");
					holderBF.bFFGridview.setAdapter(holderBF.bFFGridAdapter);// 设置菜单Adapter
				} else {
					Toast.makeText(context, R.string.no_sp, Toast.LENGTH_SHORT)
							.show();
				}

			}

		} else if (BDWF.equals("BQC")) {
			ChildExpandableListHolderBQC holderBQC = null; // 半全场清空临时变量
			if (convertView == null) { // 若行未初始化
				// 通过flater初始化行视图
				convertView = mChildInflater
						.inflate(R.layout.ui_new_bd_bqc_item, null);
				// 并将行视图的5个子视图引用放到tag中
				holderBQC = new ChildExpandableListHolderBQC();
				holderBQC.tv_item_num = (TextView) convertView
						.findViewById(R.id.tv_item_num);
				holderBQC.tv_item_no_endtime = (TextView) convertView
						.findViewById(R.id.tv_item_no_endtime);
				holderBQC.tv_matchname = (TextView) convertView
						.findViewById(R.id.tv_item_match_name);
				holderBQC.tv_hteam = (TextView) convertView
						.findViewById(R.id.tv_item_hteam);
				holderBQC.tv_vteam = (TextView) convertView
						.findViewById(R.id.tv_item_vteam);
				holderBQC.button01 = (Button) convertView
						.findViewById(R.id.btn_item_s);
				// 设置gridview显示与否
				holderBQC.llBQCGridview = (LinearLayout) convertView
						.findViewById(R.id.ll_myGridView_banqc);
				holderBQC.bqcGridview = (JczqGridview) convertView
						.findViewById(R.id.jczq_myGridView_banqc);
				convertView.setTag(holderBQC);
			} else { // 若行已初始化，直接从tag属性获得子视图的引用
				holderBQC = (ChildExpandableListHolderBQC) convertView.getTag();
			}
			// 获得行数据（模型）
			final ChildDTO info = this.groups.get(position);
			if (info != null) {
				String str_nmu = "";
				// 根据模型数据，设置行视图的控件值
				if (info.nMm.length() < 4) {
					str_nmu = info.nMm;
				} else {
					str_nmu = info.nMm.substring(0, 4);
				}
				// 格式修改 130909001 截取后3位001
				holderBQC.tv_item_num.setText(info.mId);
				holderBQC.tv_item_no_endtime.setText(DateUtil.getDateTime1(info.eTime) + "截止");
				holderBQC.tv_matchname.setText(str_nmu);
				if (info.BgColor==null||"".equals(info.BgColor)){
					holderBQC.tv_matchname.setBackgroundColor(0xff000000);
				}else {
					holderBQC.tv_matchname.setBackgroundColor(Color.parseColor(info.BgColor));
				}
				holderBQC.tv_hteam.setText(info.hTeam);
				holderBQC.tv_vteam.setText(info.vTeam);

				holderBQC.button01.setText(info.btnBQCcontent);// "点击弹出下拉列表"

				holderBQC.button01.setSelected(info.str_sbtn);
				holderBQC.button01.setTag(info);

				holderBQC.button01
						.setOnClickListener(new View.OnClickListener() {
							@Override
							public void onClick(View v) {
								Button button01 = (Button) v;
								ChildDTO child_info1 = (ChildDTO) v.getTag();
								// // 当用户点击后，首先从零时List的取出指定mid的赛事，删除掉
								// // 用来装需要删除的元素
								// List delList = new ArrayList();
								// for (ChildDTO child : list_children) {
								// String jc_mid = child.getmId();
								// if (child_info1.getmId() == jc_mid) {
								// delList.add(child);
								// }
								// }
								// list_children.removeAll(delList);
								// // 判断赋新选中的值
								if (child_info1.str_sbtn) {
									// child_info1.setStr_sp(child_info1.str_sp.replace("3,"+info.sPspf.split("-")[0]+"/",
									// ""));
									// gridview不显示
									child_info1.setShowBQCGrid(false);
									child_info1.str_sbtn = false;
									button01.setSelected(child_info1.str_sbtn);
								} else {
									child_info1.setShowBQCGrid(true);
									child_info1.str_sbtn = true;
									button01.setSelected(child_info1.str_sbtn);
								}
								// // 判断str_sp是否为空，空的话就不回传赋值
								// // 再存入List
								// list_children.add(child_info1);
								// // 回调initMapData这个方法，转存到全局变量里，选号结束
								// ((BQCActivity)
								// context).initMapData(list_children);
								notifyDataSetChanged();
							}
						});

				// 设置gridview显示与否
				if (info.isShowBQCGrid == false) {
					holderBQC.llBQCGridview.setVisibility(View.GONE);
				} else {
					holderBQC.llBQCGridview.setVisibility(View.VISIBLE);
				}

				// 按钮的文字
				String[] titles = new String[] { "胜胜", "胜平", "胜负", "平胜", "平平",
						"平负", "负胜", "负平", "负负" };
				String[] nums;
				// if("".equals(info.sPbqc)){
				// info.sPbqc="0.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00";
				// }

				if (!"".equals(info.sPbqc)) {
					nums = info.sPbqc.split(",");
					holderBQC.myBQCGridAdapter = new BDBqcgridviewAdapter(
							titles, nums, context, groups, position);
					holderBQC.bqcGridview
							.setAdapter(holderBQC.myBQCGridAdapter);// 设置菜单Adapter
				} else {
					Toast.makeText(context, R.string.no_sp, Toast.LENGTH_SHORT)
							.show();
				}
			}
		}
		return convertView;
	}

}
